package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.YmtActivityStockRecord;

public class YmtActivityStockRecordWapper {
	SqlManager manage;

	public YmtActivityStockRecordWapper() {
		manage = new SqlManager("intpro");
	}
	
	public List<YmtActivityStockRecord> selectByOrderIdAndProdInActivityId(int orderId, int inaid)throws InterruptedException{
		Map<String,Object> m = new HashMap<>();
		m.put("OrderId", orderId);
		m.put("ProductInActivityId", inaid);
		
		
		List<YmtActivityStockRecord>  ret = manage.getSelectResults(
	            "com.ymttest.database.mapping.YmtActivityStockRecordMapper.selectByOrderIdAndProdInActivityId", m);
	    manage.commit();
	    return ret;
		
	}
	
	
	
	public List<YmtActivityStockRecord> selectByOrderIdAndProdInActivityId(long orderId, int inaid)throws InterruptedException{
		Map<String,Object> m = new HashMap<>();
		m.put("OrderId", orderId);
		m.put("ProductInActivityId", inaid);
		
		
		List<YmtActivityStockRecord>  ret = manage.getSelectResults(
	            "com.ymttest.database.mapping.YmtActivityStockRecordMapper.selectByOrderIdAndProdInActivityId", m);
	    manage.commit();
	    return ret;
		
	}
	
	
	public static void main(String[] args) throws InterruptedException {
		System.out.println(new YmtActivityStockRecordWapper().selectByOrderIdAndProdInActivityId(100000798,291095).get(0).getCatalogId());
	}
}
